//
//  UIFactory.swift
//  RC-微博0305
//
//  Created by 任淳 on 16/3/12.
//  Copyright © 2016年 ReverChun. All rights reserved.
//

import UIKit

class UIFactory {
    //抽象类工厂方法
    //创建label
    class func labelWith(text:String, textColor: UIColor, fontSize: CGFloat,alignment:NSTextAlignment = .Center)->UILabel {
        
        let lab = UILabel.labelWith(text, textColor: textColor, fontSize: fontSize ,alignment:alignment)
        
        return lab
        
    }
    
    
    //创建图片button
    class func btnWithImage(backImageName:String? ,imageName:String?) ->UIButton {
        
        let btn = UIButton.buttonWithImage(backImageName, imageName: imageName)
        
        return btn
    }
    
    
    //创建文字button
    class func buttonWithTitle(backImageName:String? ,title:String ,textColor:UIColor ,fontSize:CGFloat ,imageName:String? = nil) ->UIButton  {
        
        let btn = UIButton.buttonWithTitle(backImageName, title: title, textColor: textColor, fontSize: fontSize ,imageName:imageName)
        
        return btn
        
    }
    
    
}
